<?php
namespace Think\Template\TagLib;
use Think\Template\TagLib;
class Mytag extends TagLib{
	protected $tags = array(
		'script' => array('attr'=>'pack,src','close'=>0)
	);
	public function _script($tag){
		$pack = $tag['pack'];
		$src = $tag['src'];
		$scriptDir = C('TMPL_PARSE_STRING');
//		$file_context = file_get_contents(dirname(__APP__).$scriptDir['__JS__'] . $src);
//		$file_context = dirname(__APP__).'/Public/Js/'.$src;
		$file_context = file_get_contents('http://127.0.0.1/'.dirname(__APP__).'/Public/Js/'.$src);
		
		return <<<SCRIPT
<script>
NameSpace("$pack",function(){
var context = this;
$file_context
});
</script>
</body>
</html>
SCRIPT;
	}
}
